home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / jam / jamdisk7 / inc9110b.lzh / include / assert.h < prev    next >
C/C++ Source or Header  |  1991-04-19  |  1KB  |  40 lines

  1. /*
  2.  * Libraries and headers for PDC release 3.3 (C) 1989 Lionel Hummel.
  3.  * PDC Software Distribution (C) 1989 Lionel Hummel and Paul Petersen.
  4.  * PDC I/O Library (C) 1987 by J.A. Lydiatt.
  5.  *
  6.  * This code is freely redistributable upon the conditions that this 
  7.  * notice remains intact and that modified versions of this file not
  8.  * be included as part of the PDC Software Distribution without the
  9.  * express consent of the copyright holders.  No warrantee of any
  10.  * kind is provided with this code.  For further information, contact:
  11.  *
  12.  *  PDC Software Distribution    Internet:                     BIX:
  13.  *  P.O. Box 4006             or hummel@cs.uiuc.edu            lhummel
  14.  *  Urbana, IL  61801-8801       petersen@uicsrd.csrd.uiuc.edu
  15.  */
  16.  
  17. /* assert.h
  18.  *
  19.  *  Tests a given conditional and program aborts with a diagnostic message
  20.  *  if false.
  21.  */
  22.  
  23. /*
  24.  *  2.3.91 sjw; fix up report of actual assertion as string
  25.  * 19.4.91 sjw; make into expression, so can be used in eg 'if'.
  26.  */
  27.  
  28. #ifndef __ASSERT_H__
  29. #define __ASSERT_H__
  30.  
  31. #ifndef NDEBUG
  32. int _assert_fail(const char *exp, const char *file, int line);
  33. #define assert(x) ((void)((x)||_assert_fail(#x, __FILE__, __LINE__)))
  34. #else
  35. #define assert(x)
  36. #endif
  37.  
  38. #endif /* __ASSERT_H__ */
  39.  
  40.